package spring.com.rocketmq.controller;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.com.rocketmq.service.RocketMqProductService;

import java.util.ArrayList;
/**
 * @author liux
 * @date 2021/6/1 15:56
 */
@RestController
@AllArgsConstructor
@Slf4j
@RequestMapping("/admin/rocketmq")
public class ProducerController {

    private final RocketMqProductService rocketMqProductService;

    @GetMapping("/msg/product")
    public String test() throws Exception {
        ArrayList<String> arrayList = new ArrayList<>();
        //调用生成订单号的工具类
        for (int i=0;i<10;i++){
            String orderSn =i+"看啊可能";
            arrayList.add("生成的订单号为："+orderSn);
        }
        return rocketMqProductService.openAccountMsg(arrayList);
    }
}


